home *** CD-ROM | disk | FTP | other *** search
- #include "formline.h"
- #include "khbgi.h"
- #include "patterns.h"
-
- void FormLine::show(loc xy, int len, char* text, int pat)
- {
- rect tmp(screenXL(xy.X), screenYT(xy.Y),
- screenXR(xy.X + len) + area[border_type].origin.X
- + area[border_type].corner.X,
- screenYB(xy.Y) + area[border_type].origin.Y
- + area[border_type].corner.Y
- + pScreenSet->standart_height + 2);
- Carcase::show(border_type, tmp);
- bar(tmp = rect(tmp.origin + area[border_type].origin,
- tmp.corner - area[border_type].corner),
- (int)pColorSet->colors.BAK_COLOR,
- (int)pColorSet->colors.FILL_COLOR, (uchar*)::pattern[pat]);
- char c = text[len];
- text[len] = '\0';
- Line::outtextxy(tmp.origin, text, pat);
- text[len] = c;
- }
- ////////////////////////////
- void FormLine::outtextxy(loc xy, int len, char* text, int pat)
- {
- if(xy.X + len >= 79)
- len = 78 - xy.X;
- rect tmp(screenXL(xy.X) + area[border_type].origin.X,
- screenYT(xy.Y) + area[border_type].origin.Y,
- screenXR(xy.X + len) + area[border_type].origin.X,
- screenYB(xy.Y) + area[border_type].origin.Y
- + pScreenSet->standart_height + 1);
- bar(tmp, (int)pColorSet->colors.BAK_COLOR,
- (int)pColorSet->colors.FILL_COLOR, (uchar*)::pattern[pat]);
-
- /* struct viewporttype v;
- getviewsettings(&v);
- setviewport(v.left + tmp.origin.X, v.top + tmp.origin.Y,
- v.right + tmp.corner.X, v.bottom + tmp.corner.Y, 1);
- */ Line::outtextxy(tmp.origin, text, pat);
- // setviewport(v.left, v.top, v.right, v.bottom, v.clip);
- }
- /////////////////////////
- /*
- void main()
- {
- if(!init_KNOW_HOW())
- return;
- setfillstyle(SOLID_FILL, pColorSet->colors.BAK_COLOR);
- bar(0, 0, getmaxx(), getmaxy());
-
- FormLine f(SHOW_BORDER);
- f.show(loc(10, 10), 40, "Hello, WORLD !", 16);
- f.outtextxy(loc(10, 10), 40, "KNOW-HOW 4.x", 27);
- close_KNOW_HOW();
- closegraph();
- }
- */